Autofocus systems automatically focus a camera lens on a subject. Focusing the lens involves adjusting position of the lens components until a sharp image of the subject is projected onto an image sensor (e.g., film or a charge coupled device). One approach to achieving autofocus uses a form of sound navigation ranging which bounces a sound wave off of a target object. For example, a camera may compute the amount of time it takes for a reflected ultrasonic sound wave to return to the camera and then adjust the lens position accordingly. This use of sound has its limitations. For example, if a user is taking a picture from inside a tour bus with the windows closed, the sound waves may bounce off of the window instead of the target object (or subject), thereby causing the camera lens to focus incorrectly.
Another approach for implementing autofocus in digital cameras includes determining the distance to the subject by analyzing image content. The camera examines image data and adjusts the lens components back and forth searching for the best focus position based upon analysis of image data. Typically, a series of images corresponding to selected pixels from a center region, or from another window, of a charge coupled device (CCD) are taken at different camera lens positions.
A microprocessor in the camera examines the data from pixels in each of the images and determines the difference in intensity among the adjacent pixel data. If a scene is out of focus, data from adjacent pixels generally have very similar intensities. The microprocessor causes the camera lens to move, examines data from the CCD's selected pixels, and determines whether the difference in intensity between data of adjacent pixels has improved or become worse. The microprocessor then searches for a point where there is maximum intensity difference between data of adjacent pixels, aggregated over all of the pixels in the selected autofocus window. This aggregate is called a “focus metric.” The peak of the focus metric over all of the images taken at different lens positions is then determined to be the point of best focus.
A problem with the above-described autofocus system can arise if a photographer's hand shakes while the photographer is trying to capture an image. Hand shake movement may cause high contrast scene information to move into and/or out of the edge of the autofocus window during the autofocus process. Hand shake movement may cause the focus metric to rise and fall due to the movement, resulting in a “false peak.” As a result, the focus position of the camera lens occurs at a position that is not favorable for capturing an image that is properly focused on the subject.
Other types of camera movement may also cause poor image focus. For example, image capture may occur while the user is traveling in an automobile moving over a bumpy road.